<?php
$page_title="Manage Projects";
include("includes/header.php");

$proj_id=$_GET["proj_id"];
$query = "SELECT * FROM bkitc_projects where proj_id=".$proj_id;
$mode=$_GET["mode"];


if($mode=="edit") 	$proj_info=@array_pop(qry_data("select * from bkitc_projects where proj_id=".$proj_id));
if($mode=="del"){
	exec_qry("update bkitc_projects set rec_status=0 where proj_id=".$proj_id);//Soft Delete
	header("location:proj_list.php");
}
?>				
<div class="fleft">
<ul class="subMenu">
<li><a href="edit_proj.php?mode=add">Add New </a></li>
<li><a href="proj_list.php?mode=result">Back to Project List </a></li>
</ul>
</div>
<div class="cleardiv"></div>
	<div style="width:100%" class="content_bg">
	<form method="post" action="edit_proj_pro.php?proj_id=<?=$_GET["proj_id"]?>" > 
		<table class="voip_form" width="600"  cellpadding="8" border="0" cellspacing="3"> 
			<tr>
				<td  height="10" style="padding:2px;margin:2px" colspan="2" align="right"><small style="font-size:11px"> <i><?=ast()?>  Required fields.</i></small></td>
			</tr>
			<tr >
				<td width="250" class="frmLabel">Project  Title <?=ast()?></td>
				<td > <input type="text" class="txtbox"  name="proj_title" size="60" value="<?=$proj_info["proj_title"]?>"> </td>
			</tr>
			<tr >
				<td width="250" class="frmLabel">Project  Code <?=ast()?></td>
				<td > <input type="text" class="txtbox"  name="proj_code" size="60" value="<?=$proj_info["proj_code"]?>"> </td>
			</tr>
			<?/*
			<tr>
			
				<td class="frmLabel">  Type <?=ast()?></td>
				<td>
					<input type="radio"    name="proj_type" value="0" id="rdproj" <?if($proj_info["proj_type"]==0) echo "checked"; ?>> <label for="rdproj">Web Application</label>
					<input type="radio"   name="proj_type"  value="1" id="rdEvent" <?if($proj_info["proj_type"]==1) echo "checked"; ?>><label for="rdEvent">Windows Application</label> 
				</td>
			</tr>
			<tr >
				<td class="frmLabel">  Category <?=ast()?></td>
				<td>
					<?=createSelect("proj_category", $project_category,  $selected = $proj_info["proj_category"],"")?>
				</td>
			</tr>
			*/?>
			<tr>
				<td colspan="2">
			
			<tr>
				<td width="260" class="frmLabel"> Start Date <?=ast()?></td>
				<td > 
				
					<script language="javascript">
					<?
						if($proj_info["proj_start"]=="") 
							echo "DateInput('proj_start', true, 'YYYY-MM-DD')";
						else
							echo "DateInput('proj_start', true, 'YYYY-MM-DD','".$proj_info['proj_start']."')";
					?>
					</script>
				
				</td>
			</tr>
		

						<tr>
			<td class="frmLabel">Is Project Active </td>
			<td>
				<input type="radio"   name="rec_active" value="1" id="rdShow" <?if($proj_info["rec_active"]==1) echo "checked"; ?>> <label for="rdShow">Yes</label>
				<input type="radio"   name="rec_active"  value="2" id="rdHide" <?if($proj_info["rec_active"]==2) echo "checked"; ?>><label for="rdHide">No</label> 
			</td>
			</tr>

			<tr>
				<td class="frmLabel" valign="top" colspan="2"> Description <?=ast()?><br/><br/>
				 <textarea class="txtarea"  id="proj_desc" rows="14" cols="90" name="proj_desc" style="width:800px;height:250px;"><?=$proj_info["proj_desc"]?></textarea> </td>
			</tr>
			<tr>
				<td class="frmLabel" valign="top" colspan="2"> Remarks <?=ast()?><br/><br/>
				 <textarea class="txtarea"  id="proj_remarks" rows="4" cols="110" name="proj_remarks" ><?=$proj_info["proj_remarks"]?></textarea> </td>
			</tr>
			
	
			<tr bgcolor="#fff" style="height:50px;margin:0px;padding:0px;">
				
				<td  style="margin:0px;padding:2px;" align="right" colspan="2">
				<input type="submit" class="button"  value="Save Info">&nbsp;
				<input class="button" type="reset">
				<input onclick="location.href='proj_list.php'"  type="button" class="button" value=" Back to Project List">
				</td>
			</tr>
			
		</table>
	</form>
</div>

<div style="margin-bottom:40px">

</div>
<link rel="stylesheet" href="includes/wysiwyg.css" type="text/css">
<script type="text/javascript" src="includes/scripts/wysiwyg.js"></script>
<script type="text/javascript" src="includes/scripts/wysiwyg-settings.js"></script>
		<!-- 
			Attach the editor on the textareas
		-->
		<script type="text/javascript">
			
			// Use it to attach the editor directly to a defined textarea
			WYSIWYG.attach('proj_desc'); // default setup
			
		</script>

<? include("includes/footer.php");?>
